import service from '@/utils/request'

// @Tags MasterBOM
// @Summary 创建Master BOM
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.MasterBOM true "创建Master BOM"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"创建成功"}"
// @Router /masterBOM/createMasterBOM [post]
export const createMasterBOM = (data) => {
  return service({
    url: '/masterBOM/createMasterBOM',
    method: 'post',
    data
  })
}

// @Tags MasterBOM
// @Summary 删除Master BOM
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.MasterBOM true "删除Master BOM"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /masterBOM/deleteMasterBOM [delete]
export const deleteMasterBOM = (params) => {
  return service({
    url: '/masterBOM/deleteMasterBOM',
    method: 'delete',
    params
  })
}

// @Tags MasterBOM
// @Summary 批量删除Master BOM
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body request.IdsReq true "批量删除Master BOM"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"删除成功"}"
// @Router /masterBOM/deleteMasterBOM [delete]
export const deleteMasterBOMByIds = (params) => {
  return service({
    url: '/masterBOM/deleteMasterBOMByIds',
    method: 'delete',
    params
  })
}

// @Tags MasterBOM
// @Summary 更新Master BOM
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data body model.MasterBOM true "更新Master BOM"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"更新成功"}"
// @Router /masterBOM/updateMasterBOM [put]
export const updateMasterBOM = (data) => {
  return service({
    url: '/masterBOM/updateMasterBOM',
    method: 'put',
    data
  })
}

// @Tags MasterBOM
// @Summary 用id查询Master BOM
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query model.MasterBOM true "用id查询Master BOM"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"查询成功"}"
// @Router /masterBOM/findMasterBOM [get]
export const findMasterBOM = (params) => {
  return service({
    url: '/masterBOM/findMasterBOM',
    method: 'get',
    params,
    // donNotShowLoading:true,
  })
}

// @Tags MasterBOM
// @Summary 分页获取Master BOM列表
// @Security ApiKeyAuth
// @accept application/json
// @Produce application/json
// @Param data query request.PageInfo true "分页获取Master BOM列表"
// @Success 200 {string} string "{"success":true,"data":{},"msg":"获取成功"}"
// @Router /masterBOM/getMasterBOMList [get]
export const getMasterBOMList = (params) => {
  return service({
    url: '/masterBOM/getMasterBOMList',
    method: 'get',
    params
  })
}


// 根据款式编号同步 士啤配件主档
export const syncMasterBOMAccessorySpec = (data) => {
  return service({
    url: '/masterBOMAccessorySpec/syncMasterBOMAccessorySpec',
    method: 'post',
    data
  })
}

// 根据款式编号同步 物料特性
export const syncMasterBOMAMaterialProperty = (data) => {
  return service({
    url: '/masterBOMAccessorySpec/syncMasterBOMAMaterialProperty',
    method: 'post',
    data
  })
}

// 根据原件名称获取LCT
export const getLctResult = (data) => {
  return service({
    url: '/masterBOMAccessorySpec/getLctResult',
    method: 'post',
    data
  })
}

// 通过元件编号获取sap子层原件数据
export const getSapSubBom = (data) => {
  return service({
    url: '/masterBOMAccessorySpec/getSapSubBom',
    method: 'post',
    data
  })
}

// 通过元件编号获取sap子层原件数据
export const getInnerText = (data) => {
  return service({
    url: '/masterBOMAccessorySpec/getInnerText',
    method: 'post',
    data
  })
}

// 获取PDF
export const getPDFurl = (params) => {
  return service({
    url: '/masterBOM/print',
    method: 'get',
    params
  })
}

// 通过元件编号获取sap子层原件数据
export const syncMasterBomProductDocument = (data) => {
  return service({
    url: '/masterBomProductDocument/syncMasterBomProductDocument',
    method: 'post',
    data
  })
}

// 创建BOM

export const genMasterBOMList = (data) => {
  return service({
    url: 'masterBOMList/genMasterBOMList',
    donNotShowLoading: true,
    method: 'post',
    data
  })
}

// 创建BOM

export const getProductSpecAccessorySpecListFromSap = (params) => {
  return service({
    url: '/productSpecAccessorySpec/getProductSpecAccessorySpecListFromSap',
    method: 'get',
    params
  })
}

// 创建bom--根据元件编号获取获取Bom包装物料数据
export const genMasterBOMListForPackage = (params) => {
  return service({
    url: '/masterBOMList/genMasterBOMListForPackage',
    method: 'get',
    params
  })
}

// 历史版本
export const getMasterBomHistoryList = (params) => {
  return service({
    url: '/masterBOM/getMasterBomHistoryList',
    method: 'get',
    params
  })
}

// 历史版本
export const getMasterBomHistory = (params) => {
  return service({
    url: '/masterBOM/getMasterBomHistory',
    method: 'get',
    params
  })
}